package com.example.film.service;

import com.example.film.entity.AreaWeekSell;
import com.example.film.mapper.AreaWeekSellMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AreaWeekSellServiceImpl implements AreaWeekSellService{
    @Autowired
    private AreaWeekSellMapper areaWeekSellMapper;

    @Override
    public List<AreaWeekSell> findAreaWeekSell() {
        return areaWeekSellMapper.findAreaWeekSell();
    }

    @Override
    public List<AreaWeekSell> findAreaWeekSellInfo(Integer pageNum, Integer pageSize) {
        int startIndex = (pageNum - 1) * pageSize;
        return areaWeekSellMapper.findAreaWeekSellInfo(startIndex,pageSize);
    }

    @Override
    public List<AreaWeekSell> findAreaWeekSellByWeek(Integer week) {
        return areaWeekSellMapper.findAreaWeekSellByWeek(week);
    }

    @Override
    public List<AreaWeekSell> findTotalSell(Integer week) {
        return areaWeekSellMapper.findTotalSell(week);
    }
}
